; (function (window) {

    const hlswitch = {
        template: ` <div class="hl-switch" :class="active?'hl-switch-on':'hl-switch-off'" @click.stop="swicthFun">
      <span class="hl-yuan"></span>
  </div> `,
        data() {
            return {

            }
        },
        props: {
            active: {
                type: String,
                default: false
            },
            failuretext: {
                type: String,
                default: ''
            }
        },
        watch:{

        },
        methods: {
            swicthFun() {
                if(this.failuretext){
                   hl.toast(this.failuretext)
                   return 
                }
                this.active = !this.active
                this.$emit('switchactive', this.active)
            }

        }
    }

    Vue.component('hl-switch', hlswitch)

}(window))


